package org.learn.intermediate.com.exercise;

public class Exercise03 {
    public static void main(String[] args) {
        Person person = new Person("李明",18);
        System.out.println(person.say());;
        Student student = new Student("李明",18,"256411",88);
        System.out.println(student.say());

        "hello".equals("abc");

    }
}
class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public String say(){
        return "我的名字叫 " + name + "\n年龄是" + age;
    }
}
class Student extends Person {
    private String id;
    private double score;

    public Student(String name, int age, String id, double score) {
        super(name, age);
        this.id = id;
        this.score = score;
    }

    public String say(){
        return super.say() +  "id " +  id + "成绩=" + score;
    }
}